import request from '@/utils/request'
import apis from '@/api/index'

export function getTrademarkData (parameter) {
  return request({
    url: apis.Unclaimed,
    method: 'get',
    params: parameter
  })
}

export function getFcgTrademarkData (parameter) {
  return request({
    url: apis.FcgUnclaimed,
    method: 'get',
    params: parameter
  })
}

export function getReceive (parameter) {
  return request({
    url: apis.ReceiveTrademark,
    method: 'get',
    params: parameter
  })
}

export function getLicenseList (parameter) {
  return request({
    url: apis.LicenseList,
    method: 'get',
    params: parameter
  })
}

export function getLicenseUpload (id) {
  return request({
    url: `${apis.LicenseUpload}?cb_id=${id}`,
    method: 'get'
  })
}

export function postLicenseUpload (id, data) {
  return request({
    url: `${apis.LicenseUpload}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getLicenseDownload (id) {
  return request({
    url: `${apis.LicenseDownload}?cb_id=${id}`,
    method: 'get'
  })
}

export function getTrademarkHistory (id) {
  return request({
    url: `${apis.TrademarkHistory}?cb_id=${id}`,
    method: 'get'
  })
}

export function getEditLicenseStatus (id) {
  return request({
    url: `${apis.EditLicenseStatus}?cb_id=${id}`,
    method: 'get'
  })
}

export function postArrangeLicenseStatus (id, data) {
  return request({
    url: `${apis.ArrangeLicenseStatus}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getTrademarkView (id) {
  return request({
    url: `${apis.TrademarkView}?cb_id=${id}`,
    method: 'get'
  })
}

export function getMaterialTidy (parameter) {
  return request({
    url: apis.MaterialTidy,
    method: 'get',
    params: parameter
  })
}

export function getOffficial (parameter) {
  return request({
    url: apis.OfficialList,
    method: 'get',
    params: parameter
  })
}

export function getOfficialEdit (id) {
  return request({
    url: `${apis.OfficialEdit}?cb_id=${id}`,
    method: 'get'
  })
}

export function postOfficialEdit (id, data) {
  return request({
    url: `${apis.OfficialEdit}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getDownloadMaterial (id) {
  return request({
    url: `${apis.DownloadMaterial}?cb_id=${id}`,
    method: 'get'
  })
}

export function getArrangeEdit (id) {
  return request({
    url: `${apis.ArrangeEdit}?cb_id=${id}`,
    method: 'get'
  })
}

export function postArrangeEdit (id, data) {
  return request({
    url: `${apis.ArrangeEdit}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getCollectList (parameter) {
  return request({
    url: apis.CollectList,
    method: 'get',
    params: parameter
  })
}

export function getReceiptList (id) {
  return request({
    url: `${apis.ReceiptList}?cb_id=${id}`,
    method: 'get'
  })
}
//
// export function getReceiptState (id) {
//   return request({
//     url: `${apis.ReceiptState}?cb_id=${id}`,
//     method: 'get'
//   })
// }

export function getReceiptState (id) {
  return request({
    url: `${apis.ReceiptState2}?cb_id=${id}`,
    method: 'get'
  })
}

export function postReceiptState (id, data) {
  return request({
    url: `${apis.ReceiptState2}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getReceiptDelete (id) {
  return request({
    url: `${apis.ReceiptDelete}?cbs_id=${id}`,
    method: 'get'
  })
}

export function getBatchUpload (parameter) {
  return request({
    url: apis.BatchUpload,
    method: 'get',
    params: parameter
  })
}

export function getTrademarkEdit (id) {
  return request({
    url: `${apis.TrademarkEdit}?cb_id=${id}`,
    method: 'get'
  })
}

export function postTrademarkEdit (id, data) {
  return request({
    url: `${apis.TrademarkEdit}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getTrademarkStatusEdit (id) {
  return request({
    url: `${apis.TrademarkStatusEdit}?cb_id=${id}`,
    method: 'get'
  })
}

export function postTrademarkStatusEdit (id, data) {
  return request({
    url: `${apis.TrademarkStatusEdit}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function searchTrade (parameter) {
  return request({
    url: apis.SearchTrade,
    method: 'get',
    params: parameter
  })
}

export function editReg (id, data) {
  return request({
    url: `${apis.EditRegNo}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function uploadRec (data) {
  return request({
    url: apis.UploadRegZip,
    method: 'post',
    data: data
  })
}

export function getImportLog (parameter) {
  return request({
    url: apis.GetHistory,
    method: 'get',
    params: parameter
  })
}

export function getTradeMember (parameter) {
  return request({
    url: apis.TradeMember,
    method: 'get',
    params: parameter
  })
}

export function getAdd () {
  return request({
    url: apis.AddTradeMember,
    method: 'get'
  })
}

export function postAdd (data) {
  return request({
    url: apis.AddTradeMember,
    method: 'post',
    data: data
  })
}

export function getEdit (uid) {
  return request({
    url: `${apis.EditTradeMember}?uid=${uid}`,
    method: 'get'
  })
}

export function postEdit (uid, data) {
  return request({
    url: `${apis.EditTradeMember}?uid=${uid}`,
    method: 'post',
    data: data
  })
}

export function delTradeMember (uid) {
  return request({
    url: `${apis.DelTradeMember}?uid=${uid}`,
    method: 'post'
  })
}

export function getImport () {
  return request({
    url: apis.ImportReceipt,
    method: 'get'
  })
}

export function getImportByState (id) {
  return request({
    url: `${apis.ImportReceipt}?business_id=${id}`,
    method: 'get'
  })
}

export function postImport (id, data) {
  return request({
    url: `${apis.ImportReceipt}?business_id=${id}`,
    method: 'post',
    data: data
  })
}

export function postEditReg2 (id, data) {
  return request({
    url: `${apis.EditRegNo2}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function editRegNo (id, data) {
  return request({
    url: `${apis.EditSbRegNo}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getLost (parameter) {
  return request({
    url: apis.LostReceiptPt,
    method: 'get',
    params: parameter
  })
}

export function saveLetter (data) {
  return request({
    url: 'api/v-proced/tm/upload-customer-letter',
    method: 'post',
    data
  })
}
